package com.jlcloud.core.oss.exception;

import lombok.Getter;
import com.jlcloud.core.tool.api.IResultCode;
import com.jlcloud.core.tool.api.ResultCode;

import java.io.Serial;


/**
 * OSS异常
 *
 * @author By: JlCloud <br>
 * @Package: com.jlcloud <br>
 * @CreateTime: 2024-12-03 21:45 <br>
 * @Copyright: 2021 www.jilianjituan.com Inc. All rights reserved. <br>
 * @Caution 注意：本内容仅限于冀联人力集团内部传阅，禁止外泄以及用于其他的商业目的 <br>
 */
@Getter
public class OssException extends RuntimeException {
	@Serial
	private static final long serialVersionUID = 1L;

	private final IResultCode resultCode;

	public OssException(String message) {
		super(message);
		this.resultCode = ResultCode.FAILURE;
	}

	public OssException(IResultCode resultCode) {
		super(resultCode.getMessage());
		this.resultCode = resultCode;
	}

	public OssException(IResultCode resultCode, Throwable cause) {
		super(cause);
		this.resultCode = resultCode;
	}

	/**
	 * 提高性能
	 *
	 * @return Throwable
	 */
	@Override
	public Throwable fillInStackTrace() {
		return this;
	}

	public Throwable doFillInStackTrace() {
		return super.fillInStackTrace();
	}

}
